package ee.karileet.productcatalogue.facade;

import ee.karileet.productcatalogue.model.*;

/**
 * Interface is facade for user operations in application. Exposed methods are 
 * available for user to interact with the database
 * @author Markus Karileet
 * @version 1.0
 * @created 29-nov-2013 16:09:21
 */
public interface IClientFacade {

	/**
	 * Method returns group details to caller. Argument ID must be greater than
	 * 0. When problem occurs null is returned and error is logged
	 * @param groupId    groupId
	 * @return Group
	 */
	public Group getGroupDetails(int groupId);

	/**
	 * Method returns manufactor details to caller. Argument ID must be greater 
	 * than 0. When problem occurs null is returned and error is logged
	 * @param manufactorId    manufactorId
	 * @return Manufactor
	 */
	public Manufactor getManufactorDetails(int manufactorId);

	/**
	 * Method returns product details to caller. Argument ID must be greater 
	 * than 0. When problem occurs null is returned and error is logged
	 * @param productId    productId
	 * @return Product
	 */
	public Product getProductDetails(int productId);

	/**
	 * Method returns user details to caller. Argument ID must be greater than
	 * 0. When problem occurs null is returned and error is logged
	 * @param userId    userId
	 * @return User
	 */
	public User getUserDetails(int userId);

	/**
	 * Method lists all available groups
	 * @return HashSet of groups
	 */
	public java.util.Set<Group> listGroups();

	/**
	 * Method lists all available manufactors
	 * @return HashSet of manufactors
	 */
	public java.util.Set<Manufactor> listManufactors();

	/**
	 * Method returns all products in given group. Id must be greater than 0.
	 * When problems occur, empty set is returned
	 * @param groupId    groupId
	 * @return Products in group
	 */
	public java.util.Set<Product> listProductsByGroup(int groupId);
	
	public java.util.HashMap<Manufactor, java.util.Set<Product>> listProductsByGroupWithManufactor(int groupId);

	/**
	 * Method returns all products by given manufactor. Id must be greater than 
	 * 0. When problems occur, empty set is returned
	 * @param manufactorId    manufactorId
	 * @return Products by manufactor
	 */
	public java.util.Set<Product> listProductsByManufactor(int manufactorId);

	/**
	 * Method allows user to register oneself
	 * @param name
	 * @param password    password
	 */
	public boolean register(String name, String password);

	/**
	 * Method allows user to remove oneself from system
	 * @param userId    userId
	 */
	public boolean removeUser(int userId);

	/**
	 * Method allows user to update ones details
	 * @param userId    userId
	 */
	public boolean updateUser(int userId);

}